fix: treat errored chat sessions as disconnected#1245
fix: treat errored chat sessions as disconnected#1245lopes-felipe wants to merge 1 commit intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can customize the tone of the review comments and chat replies.Configure the |
What Changed
derivePhase()in the web app to treatsession.status === "error"as"disconnected"instead of"ready"Why
The chat UI was treating provider/runtime failures as a normal ready state because errored sessions fell through the phase mapping. That left the composer in regular ready-state UI after a session failure.
Mapping errored sessions to
"disconnected"keeps the chat view aligned with the actual backend session state and avoids presenting a failed thread as ready for normal interaction.Checklist
Note
Fix
derivePhaseto return 'disconnected' for errored chat sessionsPreviously,
derivePhasein session-logic.ts only returned'disconnected'fornullor'closed'sessions, so sessions withstatus: 'error'incorrectly returned'ready'. The fix adds'error'to the disconnected condition, matching it with the null/closed cases.Macroscope summarized 6b6d83e.